﻿Public Class FrmDetails
    Dim Today As Date = New Date(Now.Year, Now.Month, Now.Day)
    Dim mouseOffset As Point

    Private Sub OK_Button_Click(sender As Object, e As EventArgs) Handles BtnClose.Click
        Me.Close()
    End Sub

    Private Sub FrmDetails_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        BtnClose.FlatAppearance.MouseOverBackColor = MyColor
        PnlTitle.BackColor = MyColor
        BtnCls.FlatAppearance.MouseOverBackColor = ControlPaint.Light(MyColor)
        Me.Text = String.Format(" كاتی بانگەكان بە ئاسۆی پارێزگای {0}", Cities(City))
        If DataGridView1.Rows.Count < 10 Then
            DataGridView1.Rows.Add(10)
            DataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = MyColor
            'Fill up DataGridView1
            For r = 0 To 9 'Fill up 10 Rows
                For c = 0 To PrayerTimes(Today.AddDays(r)).Length - 1 ' Fill up all of the cells that Prayertimes Provide
                    'Change value pf Cth Cell in Rth Row.
                    DataGridView1.Rows(r).Cells(c).Value = PrayerTimes(Today.AddDays(r))(c)
                Next
            Next
        End If
    End Sub
    Private Sub PictTitle_MouseDown(sender As Object, e As MouseEventArgs) Handles PnlTitle.MouseDown, LblTitle.MouseDown
        mouseOffset = New Point(-e.X, -e.Y)
    End Sub

    Private Sub PictTitle_MouseMove(sender As Object, e As MouseEventArgs) Handles PnlTitle.MouseMove, LblTitle.MouseMove
        If e.Button = MouseButtons.Left Then
            Dim mousePos = Control.MousePosition
            mousePos.Offset((mouseOffset.X), (mouseOffset.Y))
            Location = mousePos
        End If
    End Sub

    Private Sub BtnCls_Click(sender As Object, e As EventArgs) Handles BtnCls.Click
        Me.Close()
    End Sub

End Class